﻿@{
    Layout = "_LayoutUnAuth";
    ViewData["Title"] = "用户登陆";
}
@model LoginViewModel

<div style="margin-top:10%;">
    <div class="text-center">
        <h2>统一认证与授权中心</h2>
    </div>
    <div class="panel panel-default">
        <div class="form-content" data-toggle="form" data-field="Login" id="Login" data-size="12,4,6">
            <div class="form-body">
                <div class="row">
                    <input data-field="UserName" name="UserName" data-label="用户名" data-icon="glyphicon glyphicon-user" />
                    <input data-field="Password" name="Password" type="password" data-label="密&nbsp;&nbsp;&nbsp;&nbsp;码" data-icon="glyphicon glyphicon-lock" />
                    <span data-field="AutoLogin" data-label="记住我" type="checkbox"></span>
                </div>
                <div class="row">
                    <div class="col-md-4">
                    </div>
                    <div class="col-md-8" style="padding-left:0px; margin-left:-5px;">
                        <button data-button="post" data-url="/Account/Login" data-success="#:Account.onLoginSuccess" data-success-text="登陆成功" data-enter-press="true">登 陆</button>
                        <button data-button="cancel" data-url="/"></button>
                    </div>
                </div>
            </div>
            <div class="form-body">
                @if (Model.VisibleExternalProviders.Any())
                {
                    <div class="row text-center" style="margin-top:35px;margin-bottom:25px;">
                        <div class="card">
                            <div class="card-header">
                                <h4>其他登陆方式</h4>
                            </div>
                            <div class="card-body">
                                <ul class="list-inline">
                                    @foreach (var provider in Model.VisibleExternalProviders)
                                    {
                                        <li class="list-inline-item">
                                            <a class="btn"
                                       asp-controller="External"
                                       asp-action="Challenge"
                                       asp-route-scheme="@provider.AuthenticationScheme"
                                       asp-route-returnUrl="@Model.ReturnUrl">
                                                <img src="@provider.Icon" alt="@provider.DisplayName" />
                                            </a>
                                        </li>
                                    }
                                </ul>
                            </div>
                        </div>
                    </div>
                }

                @if (!Model.EnableLocalLogin && !Model.VisibleExternalProviders.Any())
                {
                    <div class="alert alert-warning">
                        <strong>Invalid login request</strong>
                        There are no login schemes configured for this request.
                    </div>
                }
            </div>
        </div>
    </div>
</div>

<style>
    .panel-default {
        width: 420px;
        margin-top: 15px;
        margin-left: auto;
        margin-right: auto;
    }

    .form-heading {
        height: 35px;
        margin-top: 15px;
    }

    .form-body {
        margin-top: 15px;
    }

    [data-toggle="form"] .form-group {
        margin-top: 15px;
        /*margin-bottom: 15px;*/
        padding-right: 30px;
    }

    .card .card-body .btn {
        border-radius: 50px;
        line-height: 1em;
        padding: 6px 6px;
    }

        .card .card-body .btn img {
            height: 32px;
            width: 32px;
        }
</style>